package com.example.tests;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import java.util.Set;

import org.testng.annotations.Test;

public class ContactRemovalTests extends TestBase {

	@Test
	public void testFirstContactCanBeRemoved() throws Exception {
		Set<ContactObject> oldList = app.getContactHelper().getContacts();
		int numberOfContactForDeleting = 2;
		app.getContactHelper().deleteContact(numberOfContactForDeleting);
		// validate
		Set<ContactObject> newList = app.getContactHelper().getContacts();
		verifyContactDeleted(oldList, newList);
	}

	private void verifyContactDeleted(Set<ContactObject> oldList,
			Set<ContactObject> newList) {
		assertThat(newList.size(), equalTo(oldList.size() - 1));
		// assertThat(newList, NOTequalTo(oldList));		
	}

}
